#include "drv_touch.h"

/* touch 触摸屏驱动 */

/* static var */


#if defined(CONFIG_HW_TOUCH_ID_FT6336)
  extern _drv_touch_opt_t touch_opt_ft6336_t;
  static _drv_touch_opt_t *touch_opt_t = &touch_opt_ft6336_t;
#elif defined(CONFIG_HW_TOUCH_ID_FT5206)
  #error "Touch Driver FT5206 Not Support!"
#elif defined(CONFIG_HW_TOUCH_ID_GT911)
  #error "Touch Driver FT5206 Not Support!"
#else
  #error "Touch Driver Not Select"
#endif



/* static func */




/* export func */

/**
 * @brief 触摸初始化
 * 
 * @return int 
 */
int drv_touch_init(void)
{
    int ret = 0;

    ret = touch_opt_t->init();

    return ret;
}

/**
 * @brief 触摸扫描
 * 
 * @param point 触点信息
 * @return int 
 */
int drv_touch_scan(_drv_touch_point_t *point)
{
    if (point == NULL) return -1;

    return touch_opt_t->scan(point);
}

/**
 * @brief 获取触摸模块信息
 * 
 * @param info 
 * @return int 
 */
int drv_touch_get_info(_drv_touch_info_t *info)
{
    if (info == NULL) return -1;

    return touch_opt_t->get_info(info);
}
